<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .welcome {
            font-size: 48px;
            text-align: center;
            color: #009688;
        }
    </style>
</head>
<body>
<h2 class="welcome"></h2>
</body>
</html>
<script>
    $.ajax({
        url: '/user/userStatus',
        method: 'get',
        async: false,
        success: (data) => {
            let h2tar = document.getElementsByClassName("welcome")[0];
            console.log(data)
            console.log(typeof data.userType);
            if (data.userType === '1') {
                h2tar.innerText = data.username + ':欢迎使用21软件0102教务管理系统Teacher端'
            } else if (data.userType === '2') {
                h2tar.innerText = data.username + ':欢迎使用21软件0102教务管理系统Student端'
            }
        }
    })
</script>